<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FreeRTOS图片资源 - FreeRTOS学习笔记</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f4f4f4;
        }

        header {
            background: linear-gradient(135deg, #2c3e50, #3498db);
            color: white;
            text-align: center;
            padding: 2rem 0;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

        .subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        nav {
            background-color: #2c3e50;
            padding: 0;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        nav ul {
            list-style: none;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
        }

        nav li {
            margin: 0;
        }

        nav a {
            display: block;
            color: white;
            text-decoration: none;
            padding: 1rem 1.5rem;
            transition: background-color 0.3s;
        }

        nav a:hover {
            background-color: #3498db;
        }

        .container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        .content {
            background-color: white;
            border-radius: 8px;
            padding: 2rem;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        h2 {
            color: #2c3e50;
            border-bottom: 2px solid #3498db;
            padding-bottom: 0.5rem;
            margin-bottom: 1.5rem;
        }

        h3 {
            color: #3498db;
            margin: 1.5rem 0 1rem;
        }

        p {
            margin-bottom: 1rem;
        }

        ul, ol {
            margin-left: 2rem;
            margin-bottom: 1rem;
        }

        li {
            margin-bottom: 0.5rem;
        }

        .image-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }

        .image-card {
            border: 1px solid #ddd;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            transition: transform 0.3s;
            cursor: pointer;
        }

        .image-card:hover {
            transform: translateY(-5px);
        }

        .image-card img {
            width: 100%;
            height: 200px;
            object-fit: contain;
            background-color: #f8f8f8;
            display: block;
        }

        .image-info {
            padding: 1rem;
        }

        .image-info h4 {
            margin-bottom: 0.5rem;
            color: #2c3e50;
        }

        .image-info p {
            font-size: 0.9rem;
            color: #666;
            margin-bottom: 0;
        }

        /* 图片全屏查看模态框样式 */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            overflow: auto;
        }

        .modal-content {
            display: block;
            margin: auto;
            max-width: 90%;
            max-height: 90%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .modal-caption {
            color: #fff;
            text-align: center;
            margin: 1rem auto;
            max-width: 80%;
            font-size: 1.2rem;
        }

        .close {
            position: absolute;
            top: 20px;
            right: 35px;
            color: #fff;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            z-index: 1001;
        }

        .close:hover {
            color: #ccc;
        }

        .nav-buttons {
            position: absolute;
            top: 50%;
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 20px;
            box-sizing: border-box;
        }

        .nav-button {
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
            font-size: 30px;
            font-weight: bold;
            padding: 10px 15px;
            cursor: pointer;
            border: none;
            border-radius: 5px;
            user-select: none;
        }

        .nav-button:hover {
            background-color: rgba(255, 255, 255, 0.4);
        }

        .footer {
            text-align: center;
            padding: 2rem;
            background-color: #2c3e50;
            color: white;
            margin-top: 2rem;
        }

        @media (max-width: 768px) {
            nav ul {
                flex-direction: column;
            }

            .container {
                padding: 0 1rem;
            }

            h1 {
                font-size: 2rem;
            }

            .image-grid {
                grid-template-columns: 1fr;
            }
            
            .nav-buttons {
                padding: 0 10px;
            }
            
            .nav-button {
                font-size: 20px;
                padding: 5px 10px;
            }
        }
    </style>
    <!-- 引入浮动笔记窗口脚本 -->
    <script src="float-notes.js"></script>
</head>
<body>
    <header>
        <h1>FreeRTOS学习笔记</h1>
        <p class="subtitle">实时操作系统核心概念与应用详解</p>
    </header>

    <nav>
        <ul>
            <li><a href="index.html">主页</a></li>
            <li><a href="chapter1.html">基础知识</a></li>
            <li><a href="chapter2.html">任务管理</a></li>
            <li><a href="chapter3.html">任务调度</a></li>
            <li><a href="chapter4.html">内存管理</a></li>
            <li><a href="chapter5.html">队列</a></li>
            <li><a href="chapter6.html">信号量</a></li>
            <li><a href="chapter7.html">软件定时器</a></li>
            <li><a href="image_gallery.html">图片资源</a></li>
        </ul>
    </nav>

    <div class="container">
        <div class="content">
            <h2>FreeRTOS 图片资源库</h2>
            <p>本页面展示了FreeRTOS学习笔记中使用的所有图片资源，这些图片有助于更好地理解FreeRTOS的各种概念和机制。点击任意图片可全屏查看。</p>
            
            <div class="image-grid">
                <!-- 任务管理相关 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/抢占式调度.png" alt="抢占式调度">
                    <div class="image-info">
                        <h4>抢占式调度</h4>
                        <p>展示高优先级任务如何抢占低优先级任务的执行</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/时间片调度.png" alt="时间片调度">
                    <div class="image-info">
                        <h4>时间片调度</h4>
                        <p>展示相同优先级任务如何按时间片轮转执行</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/任务状态转换关系.png" alt="任务状态转换关系">
                    <div class="image-info">
                        <h4>任务状态转换关系</h4>
                        <p>展示FreeRTOS中任务的四种状态及其转换关系</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/任务控制块结构体成员.png" alt="任务控制块结构体成员">
                    <div class="image-info">
                        <h4>任务控制块结构体成员</h4>
                        <p>FreeRTOS任务控制块(TCB)的结构体成员</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/任务创建时任务堆栈所存内容.png" alt="任务创建时任务堆栈所存内容">
                    <div class="image-info">
                        <h4>任务创建时堆栈内容</h4>
                        <p>新创建任务的堆栈初始内容</p>
                    </div>
                </div>
                
                <!-- 列表和列表项 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/列表和列表项关系.png" alt="列表和列表项关系">
                    <div class="image-info">
                        <h4>列表和列表项关系</h4>
                        <p>FreeRTOS中列表和列表项的关系</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/列表结构体.png" alt="列表结构体">
                    <div class="image-info">
                        <h4>列表结构体</h4>
                        <p>列表结构体的定义</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/列表项结构体.png" alt="列表项结构体">
                    <div class="image-info">
                        <h4>列表项结构体</h4>
                        <p>列表项结构体的定义</p>
                    </div>
                </div>
                
                <!-- 调度和中断 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/PendSV和Systick中断优先级1.png" alt="PendSV和Systick中断优先级1">
                    <div class="image-info">
                        <h4>PendSV和SysTick中断优先级</h4>
                        <p>PendSV和SysTick中断优先级配置示例</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/系统中断配置寄存器.png" alt="系统中断配置寄存器">
                    <div class="image-info">
                        <h4>系统中断配置寄存器</h4>
                        <p>系统中断配置相关寄存器</p>
                    </div>
                </div>
                
                <!-- 队列 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/消息队列创建、读写过程.png" alt="消息队列创建、读写过程">
                    <div class="image-info">
                        <h4>消息队列创建和读写过程</h4>
                        <p>消息队列的创建和读写过程</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/队列结构体示意图.png" alt="队列结构体示意图">
                    <div class="image-info">
                        <h4>队列结构体示意图</h4>
                        <p>队列结构体的示意图</p>
                    </div>
                </div>
                
                <!-- 信号量 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/信号量简介.png" alt="信号量简介">
                    <div class="image-info">
                        <h4>信号量简介</h4>
                        <p>信号量的基本概念</p>
                    </div>
                </div>
                
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/二值信号量介绍.png" alt="二值信号量介绍">
                    <div class="image-info">
                        <h4>二值信号量介绍</h4>
                        <p>二值信号量的介绍</p>
                    </div>
                </div>
                
                <!-- 事件标志组 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/事件标志组与队列-信号量区别.png" alt="事件标志组与队列-信号量区别">
                    <div class="image-info">
                        <h4>事件标志组与队列信号量区别</h4>
                        <p>事件标志组与队列、信号量的区别</p>
                    </div>
                </div>
                
                <!-- 任务通知 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/任务通知的通信.png" alt="任务通知的通信">
                    <div class="image-info">
                        <h4>任务通知的通信</h4>
                        <p>任务通知的通信机制</p>
                    </div>
                </div>
                
                <!-- 软件定时器 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/软件定时器相关函数.png" alt="软件定时器相关函数">
                    <div class="image-info">
                        <h4>软件定时器相关函数</h4>
                        <p>软件定时器相关函数</p>
                    </div>
                </div>
                
                <!-- 内存管理 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/内存管理算法种类.png" alt="内存管理算法种类">
                    <div class="image-info">
                        <h4>内存管理算法种类</h4>
                        <p>内存管理算法种类</p>
                    </div>
                </div>
                
                <!-- 中断管理 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/中断优先级分配方式.png" alt="中断优先级分配方式">
                    <div class="image-info">
                        <h4>中断优先级分配方式</h4>
                        <p>中断优先级分配方式</p>
                    </div>
                </div>
                
                <!-- 低功耗模式 -->
                <div class="image-card" onclick="openModal(this)">
                    <img src="images/STM32低功耗模式.png" alt="STM32低功耗模式">
                    <div class="image-info">
                        <h4>STM32低功耗模式</h4>
                        <p>STM32低功耗模式</p>
                    </div>
                </div>
            </div>
            
            <h3>更多图片</h3>
            <p>完整图片列表请参考 <a href="images/README.md">图片说明文档</a>。</p>
        </div>
    </div>

    <!-- 图片全屏查看模态框 -->
    <div id="imageModal" class="modal">
        <span class="close" onclick="closeModal()">&times;</span>
        <div class="nav-buttons">
            <button class="nav-button" onclick="changeImage(-1)">&#10094;</button>
            <button class="nav-button" onclick="changeImage(1)">&#10095;</button>
        </div>
        <img class="modal-content" id="modalImage">
        <div class="modal-caption" id="modalCaption"></div>
    </div>

    <footer class="footer">
        <p>FreeRTOS学习笔记 &copy; 2025</p>
        <p>作者: zou.commit()</p>
    </footer>

    <script>
        // 当前图片索引
        let currentIndex = 0;
        // 所有图片卡片
        const imageCards = document.querySelectorAll('.image-card');
        
        // 打开模态框
        function openModal(card) {
            const modal = document.getElementById('imageModal');
            const modalImg = document.getElementById('modalImage');
            const modalCaption = document.getElementById('modalCaption');
            
            // 获取点击的图片和信息
            const img = card.querySelector('img');
            const info = card.querySelector('.image-info');
            
            // 设置模态框内容
            modalImg.src = img.src;
            modalCaption.innerHTML = '<h3>' + info.querySelector('h4').innerHTML + '</h3><p>' + info.querySelector('p').innerHTML + '</p>';
            
            // 显示模态框
            modal.style.display = 'block';
            
            // 设置当前索引
            currentIndex = Array.from(imageCards).indexOf(card);
        }
        
        // 关闭模态框
        function closeModal() {
            document.getElementById('imageModal').style.display = 'none';
        }
        
        // 切换图片
        function changeImage(direction) {
            currentIndex += direction;
            
            // 循环浏览
            if (currentIndex >= imageCards.length) {
                currentIndex = 0;
            } else if (currentIndex < 0) {
                currentIndex = imageCards.length - 1;
            }
            
            // 获取新图片信息
            const card = imageCards[currentIndex];
            const img = card.querySelector('img');
            const info = card.querySelector('.image-info');
            const modalImg = document.getElementById('modalImage');
            const modalCaption = document.getElementById('modalCaption');
            
            // 更新模态框内容
            modalImg.src = img.src;
            modalCaption.innerHTML = '<h3>' + info.querySelector('h4').innerHTML + '</h3><p>' + info.querySelector('p').innerHTML + '</p>';
        }
        
        // 点击模态框背景关闭
        window.onclick = function(event) {
            const modal = document.getElementById('imageModal');
            if (event.target === modal) {
                closeModal();
            }
        }
        
        // 键盘事件支持
        document.addEventListener('keydown', function(event) {
            const modal = document.getElementById('imageModal');
            if (modal.style.display === 'block') {
                if (event.key === 'Escape') {
                    closeModal();
                } else if (event.key === 'ArrowLeft') {
                    changeImage(-1);
                } else if (event.key === 'ArrowRight') {
                    changeImage(1);
                }
            }
        });
    </script>
</body>
</html>